package com.zxy.leetcode.lcof;

/**
 * https://leetcode-cn.com/problems/shu-zu-zhong-zhong-fu-de-shu-zi-lcof/
 */
public class Test03 {

    public static void main(String[] args) {
        Test03 test = new Test03();
        int[] nums = {2, 3, 1, 0, 2, 5, 3};
        System.out.println(test.findRepeatNumber(nums));
    }

    public int findRepeatNumber(int[] nums) {
        java.util.HashSet set = new java.util.HashSet();
        for (int num : nums) {
            if (set.contains(num)) {
                return num;
            }
            set.add(num);
        }
        return 0;
    }



}
